package com.gengdan.service.impl;

import com.gengdan.bean.UserInfoBean;
import com.gengdan.dao.UserInfoDao;
import com.gengdan.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * @author Sun Mingshan
 * @Description TODO
 * @date 2020/4/20 21:09
 */
@Service
public class UserInfoServiceImpl implements UserInfoService {

    @Autowired
    UserInfoDao userInfoDao;

    @Override
    public HashMap selectPersonalInfo(int userId) {
        HashMap<String,Object> hm = new HashMap<String, Object>();

        List<UserInfoBean> userInfoBean = userInfoDao.selectPersonalInfo(userId);

        if(userInfoBean.isEmpty()){
            hm.put("status","0");
            hm.put("msg","查询失败");
            hm.put("select_Personal_Info",userInfoBean);
            return hm;
        }

        hm.put("status","1");
        hm.put("msg","查询成功");
        hm.put("select_Personal_Info",userInfoBean);
        return hm;
    }
}
